package com.dongjiantong.common.core;

import org.springframework.context.ApplicationContext;
/**
 * 在SpringBoot应用中获取应用上下文方法
 *
 * @author hyson
 * @create 2017-02-27 15:27
 */
public class SpringContextUtil {
    private static ApplicationContext applicationContext;

    public static void setApplicationContext(ApplicationContext context) {
        applicationContext = context;
    }

    public static Object getBean(String beanId) {
        return applicationContext.getBean(beanId);
    }
}
